import { createRouter, createWebHistory } from 'vue-router';
import Login from '../views/Login.vue';
import Register from '../views/Register.vue';
import Nav from '../views/Nav.vue'
import Enroll from '../views/Enroll.vue'
import ModifyPassword from "@/views/ModifyPassword.vue";
import NumberRecord from "@/views/NumberRecord.vue";
import NumberAllocation from "@/views/NumberAllocation.vue";
import NumberBeautiful from "@/views/NumberBeautiful.vue";
import NumberBeautifulMarket from "@/views/NumberBeautifulMarket.vue";

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            // 添加重定向规则，当访问根路径时，重定向到注册页面
            redirect: '/login'
        },
        {
            path: '/register',
            name: 'Register',
            component: Register
        },
        {
            path: '/login',
            name: 'Login',
            component: Login
        },
        {
            path: '/nav',
            name: 'Nav',
            component: Nav
        },
        {
            path: '/enroll',
            name: 'Enroll',
            component: Enroll
        },
        {
            path: '/modify/password',
            name: 'modifyPassword',
            component: ModifyPassword
        },
        {
            path: '/number/record',
            name: 'numberRecord',
            component: NumberRecord
        },
        {
            path: '/number/allocation',
            name: 'numberAllocation',
            component: NumberAllocation
        },
        {
            path: '/number/beautiful',
            name: 'numberBeautiful',
            component: NumberBeautiful
        },
        {
            path: '/number/beautiful/market',
            name: 'numberBeautifulMarket',
            component: NumberBeautifulMarket
        }
    ]
});

export default router;
